package com.wch.demo.actuator;

import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 自定义EndPoint 信息展示
 * @author WanChengHe 20200509 
 *
 */
@ConfigurationProperties(prefix = "endpoints.customSystem")
public class StandandEndpoint extends AbstractEndpoint<Map<String, Object>>{

	
	public StandandEndpoint() {
		super("customSystem");
		// TODO Auto-generated constructor stub
	}

	@Override
	public Map<String, Object> invoke() {
		// TODO Auto-generated method stub
		Map<String,Object> result= new HashMap();
		Map systemInfo = System.getenv();
		result.put("username", systemInfo.get("USERNAME"));
		result.put("computername", systemInfo.get("COMPUTERNAME"));
		result.put("userdomain", systemInfo.get("USERDOMAIN"));
		
		return result;
	}

}
